package ZY11_1;

import java.util.InputMismatchException;
import java.util.Scanner;

public class Denglu {
    public static void main(String[] args) {
        while (true) {
            try {
                Scanner in = new Scanner(System.in);
                System.out.println("1.登录，2.注册，3.联系客服");
                int a = in.nextInt();
                switch (a) {
                    case 1:
                        System.out.println("登陆成功");
                        break;
                    case 2:
                        System.out.println("注册成功");
                        break;
                    case 3:
                        System.out.println("正在联系客服");
                        break;
                    default:
                        System.out.println("重新输入");
                        break;
                }
            } catch (InputMismatchException a) {
                System.out.println("输入的不是数字" + a);
                System.out.println("重新输入");
            } catch (Exception e) {
                System.out.println("输入错误" + e);
                System.out.println("重新输入");
            }
        }
    }
}
